package javolution.xml;

import java.io.IOException;
import java.lang.reflect.Array;
import java.util.Collection;
import java.util.Map;
import javolution.Javolution;
import javolution.JavolutionError;
import javolution.context.PersistentContext;
import javolution.lang.ClassInitializer;
import javolution.lang.Reflection;
import javolution.lang.Reusable;
import javolution.text.CharArray;
import javolution.text.Text;
import javolution.util.FastCollection;
import javolution.util.FastComparator;
import javolution.util.FastMap;
import javolution.util.Index;
import javolution.xml.XMLFormat;
import javolution.xml.stream.XMLStreamException;
import javolution.xml.stream.XMLStreamReaderImpl;
import javolution.xml.stream.XMLStreamWriterImpl;

/* loaded from: classes2.dex */
public class XMLBinding implements Reusable, XMLSerializable {
    private static FastMap STATIC_MAPPING = new FastMap().setShared(true);
    static final XMLBinding DEFAULT = new XMLBinding();
    static final XMLFormat XML = new XMLFormat(Javolution.j2meGetClass("javolution.xml.XMLBinding")) { // from class: javolution.xml.XMLBinding.1
        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
            XMLBinding xMLBinding = (XMLBinding) obj;
            String str = null;
            xMLBinding._classAttributeName = inputElement.getAttribute("classAttributeName", str);
            xMLBinding._classAttributeURI = inputElement.getAttribute("classAttributeURI", str);
            FastMap fastMap = xMLBinding._aliasToClass = (FastMap) inputElement.get("AliasToClass", FastMap.class);
            FastMap.Entry head = fastMap.head();
            FastMap.Entry tail = fastMap.tail();
            while (true) {
                head = head.getNext();
                if (head == tail) {
                    return;
                }
                xMLBinding._classToAlias.put(head.getValue(), head.getKey());
            }
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            XMLBinding xMLBinding = (XMLBinding) obj;
            outputElement.setAttribute("classAttributeName", xMLBinding._classAttributeName);
            outputElement.setAttribute("classAttributeURI", xMLBinding._classAttributeURI);
            outputElement.add((XMLFormat.OutputElement) xMLBinding._aliasToClass, "AliasToClass", (Class<XMLFormat.OutputElement>) FastMap.class);
        }
    };
    static final XMLFormat<Object> OBJECT_XML = new XMLFormat(new Object().getClass()) { // from class: javolution.xml.XMLBinding.2
        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) {
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) {
        }
    };
    static final XMLFormat<Class> CLASS_XML = new XMLFormat("".getClass().getClass()) { // from class: javolution.xml.XMLBinding.3
        @Override // javolution.xml.XMLFormat
        public boolean isReferenceable() {
            return false;
        }

        @Override // javolution.xml.XMLFormat
        public Object newInstance(Class cls, XMLFormat.InputElement inputElement) throws XMLStreamException {
            CharArray attribute = inputElement.getAttribute("name");
            if (attribute != null) {
                try {
                    return Reflection.getClass(attribute);
                } catch (ClassNotFoundException e) {
                    throw new XMLStreamException(e);
                }
            }
            throw new XMLStreamException("Attribute 'name' missing");
        }

        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            outputElement.setAttribute("name", ((Class) obj).getName());
        }
    };
    static final XMLFormat<String> STRING_XML = new XMLFormat("".getClass()) { // from class: javolution.xml.XMLBinding.4
        @Override // javolution.xml.XMLFormat
        public Object newInstance(Class cls, XMLFormat.InputElement inputElement) throws XMLStreamException {
            return inputElement.getAttribute("value", "");
        }

        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            outputElement.setAttribute("value", (String) obj);
        }
    };
    static final XMLFormat<Appendable> APPENDABLE_XML = new XMLFormat(Javolution.j2meGetClass("java.lang.Appendable")) { // from class: javolution.xml.XMLBinding.5
        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
            CharArray attribute = inputElement.getAttribute("value");
            if (attribute != null) {
                try {
                    ((Appendable) obj).append(attribute);
                } catch (IOException e) {
                    throw new XMLStreamException(e);
                }
            }
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            if (obj instanceof CharSequence) {
                outputElement.setAttribute("value", (CharSequence) obj);
            } else {
                outputElement.setAttribute("value", obj.toString());
            }
        }
    };
    static final XMLFormat<Collection> COLLECTION_XML = new XMLFormat(Javolution.j2meGetClass("java.util.Collection")) { // from class: javolution.xml.XMLBinding.6
        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
            Collection collection = (Collection) obj;
            while (inputElement.hasNext()) {
                collection.add(inputElement.getNext());
            }
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            for (Object obj2 : (Collection) obj) {
                outputElement.add(obj2);
            }
        }
    };
    static final XMLFormat<Map> MAP_XML = new XMLFormat(Javolution.j2meGetClass("java.util.Map")) { // from class: javolution.xml.XMLBinding.7
        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
            Map map = (Map) obj;
            while (inputElement.hasNext()) {
                map.put(inputElement.get("Key"), inputElement.get("Value"));
            }
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            for (Map.Entry entry : ((Map) obj).entrySet()) {
                outputElement.add(entry.getKey(), "Key");
                outputElement.add(entry.getValue(), "Value");
            }
        }
    };
    static final XMLFormat<Object[]> OBJECT_ARRAY_XML = new XMLFormat(new Object[0].getClass()) { // from class: javolution.xml.XMLBinding.8
        @Override // javolution.xml.XMLFormat
        public Object newInstance(Class cls, XMLFormat.InputElement inputElement) throws XMLStreamException {
            try {
                return Array.newInstance(Reflection.getClass(inputElement.getAttribute("componentType")), inputElement.getAttribute("length", 0));
            } catch (ClassNotFoundException e) {
                throw new XMLStreamException(e);
            }
        }

        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
            Object[] objArr = (Object[]) obj;
            for (int i = 0; i < objArr.length; i++) {
                objArr[i] = inputElement.getNext();
            }
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            Object[] objArr = (Object[]) obj;
            outputElement.setAttribute("componentType", objArr.getClass().getComponentType().getName());
            outputElement.setAttribute("length", objArr.length);
            for (Object obj2 : objArr) {
                outputElement.add(obj2);
            }
        }
    };
    static final XMLFormat<Boolean> BOOLEAN_XML = new XMLFormat(new Boolean(true).getClass()) { // from class: javolution.xml.XMLBinding.9
        @Override // javolution.xml.XMLFormat
        public boolean isReferenceable() {
            return false;
        }

        @Override // javolution.xml.XMLFormat
        public Object newInstance(Class cls, XMLFormat.InputElement inputElement) throws XMLStreamException {
            return new Boolean(inputElement.getAttribute("value", false));
        }

        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            outputElement.setAttribute("value", ((Boolean) obj).booleanValue());
        }
    };
    static final XMLFormat<Byte> BYTE_XML = new XMLFormat(new Byte((byte) 0).getClass()) { // from class: javolution.xml.XMLBinding.10
        @Override // javolution.xml.XMLFormat
        public boolean isReferenceable() {
            return false;
        }

        @Override // javolution.xml.XMLFormat
        public Object newInstance(Class cls, XMLFormat.InputElement inputElement) throws XMLStreamException {
            return new Byte((byte) inputElement.getAttribute("value", 0));
        }

        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            outputElement.setAttribute("value", (int) ((Byte) obj).byteValue());
        }
    };
    static final XMLFormat<Character> CHARACTER_XML = new XMLFormat(new Character(' ').getClass()) { // from class: javolution.xml.XMLBinding.11
        @Override // javolution.xml.XMLFormat
        public boolean isReferenceable() {
            return false;
        }

        @Override // javolution.xml.XMLFormat
        public Object newInstance(Class cls, XMLFormat.InputElement inputElement) throws XMLStreamException {
            CharArray attribute = inputElement.getAttribute("value");
            if (attribute == null || attribute.length() != 1) {
                throw new XMLStreamException("Missing or invalid value attribute");
            }
            return new Character(attribute.charAt(0));
        }

        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            outputElement.setAttribute("value", (CharSequence) Text.valueOf(((Character) obj).charValue()));
        }
    };
    static final XMLFormat<Short> SHORT_XML = new XMLFormat(new Short((short) 0).getClass()) { // from class: javolution.xml.XMLBinding.12
        @Override // javolution.xml.XMLFormat
        public boolean isReferenceable() {
            return false;
        }

        @Override // javolution.xml.XMLFormat
        public Object newInstance(Class cls, XMLFormat.InputElement inputElement) throws XMLStreamException {
            return new Short((short) inputElement.getAttribute("value", 0));
        }

        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            outputElement.setAttribute("value", (int) ((Short) obj).shortValue());
        }
    };
    static final XMLFormat<Integer> INTEGER_XML = new XMLFormat(new Integer(0).getClass()) { // from class: javolution.xml.XMLBinding.13
        @Override // javolution.xml.XMLFormat
        public boolean isReferenceable() {
            return false;
        }

        @Override // javolution.xml.XMLFormat
        public Object newInstance(Class cls, XMLFormat.InputElement inputElement) throws XMLStreamException {
            return new Integer(inputElement.getAttribute("value", 0));
        }

        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            outputElement.setAttribute("value", ((Integer) obj).intValue());
        }
    };
    static final XMLFormat<Long> LONG_XML = new XMLFormat(new Long(0).getClass()) { // from class: javolution.xml.XMLBinding.14
        @Override // javolution.xml.XMLFormat
        public boolean isReferenceable() {
            return false;
        }

        @Override // javolution.xml.XMLFormat
        public Object newInstance(Class cls, XMLFormat.InputElement inputElement) throws XMLStreamException {
            return new Long(inputElement.getAttribute("value", 0L));
        }

        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            outputElement.setAttribute("value", ((Long) obj).longValue());
        }
    };
    static final XMLFormat<Float> FLOAT_XML = new XMLFormat(new Float(0.0f).getClass()) { // from class: javolution.xml.XMLBinding.15
        @Override // javolution.xml.XMLFormat
        public boolean isReferenceable() {
            return false;
        }

        @Override // javolution.xml.XMLFormat
        public Object newInstance(Class cls, XMLFormat.InputElement inputElement) throws XMLStreamException {
            return new Float(inputElement.getAttribute("value", 0.0f));
        }

        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            outputElement.setAttribute("value", ((Float) obj).floatValue());
        }
    };
    static final XMLFormat<Double> DOUBLE_XML = new XMLFormat(new Double(0.0d).getClass()) { // from class: javolution.xml.XMLBinding.16
        @Override // javolution.xml.XMLFormat
        public boolean isReferenceable() {
            return false;
        }

        @Override // javolution.xml.XMLFormat
        public Object newInstance(Class cls, XMLFormat.InputElement inputElement) throws XMLStreamException {
            return new Double(inputElement.getAttribute("value", 0.0d));
        }

        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            outputElement.setAttribute("value", ((Double) obj).doubleValue());
        }
    };
    static final XMLFormat<Text> TEXT_XML = new XMLFormat(Javolution.j2meGetClass("javolution.text.Text")) { // from class: javolution.xml.XMLBinding.17
        @Override // javolution.xml.XMLFormat
        public Object newInstance(Class cls, XMLFormat.InputElement inputElement) throws XMLStreamException {
            CharArray attribute = inputElement.getAttribute("value");
            return attribute != null ? Text.valueOf(attribute) : Text.EMPTY;
        }

        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            outputElement.setAttribute("value", (CharSequence) ((Text) obj));
        }
    };
    static final XMLFormat<FastMap> FASTMAP_XML = new XMLFormat(new FastMap().getClass()) { // from class: javolution.xml.XMLBinding.18
        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
            FastMap fastMap = (FastMap) obj;
            fastMap.setShared(inputElement.getAttribute("shared", false));
            FastComparator fastComparator = (FastComparator) inputElement.get("KeyComparator");
            if (fastComparator != null) {
                fastMap.setKeyComparator(fastComparator);
            }
            FastComparator fastComparator2 = (FastComparator) inputElement.get("ValueComparator");
            if (fastComparator2 != null) {
                fastMap.setValueComparator(fastComparator2);
            }
            while (inputElement.hasNext()) {
                fastMap.put(inputElement.get("Key"), inputElement.get("Value"));
            }
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            FastMap fastMap = (FastMap) obj;
            if (fastMap.isShared()) {
                outputElement.setAttribute("shared", true);
            }
            if (fastMap.getKeyComparator() != FastComparator.DEFAULT) {
                outputElement.add(fastMap.getKeyComparator(), "KeyComparator");
            }
            if (fastMap.getValueComparator() != FastComparator.DEFAULT) {
                outputElement.add(fastMap.getValueComparator(), "ValueComparator");
            }
            FastMap.Entry head = fastMap.head();
            FastMap.Entry tail = fastMap.tail();
            while (true) {
                head = head.getNext();
                if (head == tail) {
                    return;
                }
                outputElement.add(head.getKey(), "Key");
                outputElement.add(head.getValue(), "Value");
            }
        }
    };
    static final XMLFormat<FastCollection> FASTCOLLECTION_XML = new XMLFormat(Javolution.j2meGetClass("javolution.util.FastCollection")) { // from class: javolution.xml.XMLBinding.19
        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
            FastCollection fastCollection = (FastCollection) obj;
            while (inputElement.hasNext()) {
                fastCollection.add(inputElement.getNext());
            }
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            FastCollection fastCollection = (FastCollection) obj;
            FastCollection.Record head = fastCollection.head();
            FastCollection.Record tail = fastCollection.tail();
            while (true) {
                head = head.getNext();
                if (head == tail) {
                    return;
                }
                outputElement.add(fastCollection.valueOf(head));
            }
        }
    };
    static final XMLFormat<FastComparator> FASTCOMPARATOR_XML = new XMLFormat(Javolution.j2meGetClass("javolution.util.FastComparator")) { // from class: javolution.xml.XMLBinding.20
        @Override // javolution.xml.XMLFormat
        public Object newInstance(Class cls, XMLFormat.InputElement inputElement) throws XMLStreamException {
            return cls == FastComparator.DEFAULT.getClass() ? FastComparator.DEFAULT : cls == FastComparator.DIRECT.getClass() ? FastComparator.DIRECT : cls == FastComparator.IDENTITY.getClass() ? FastComparator.IDENTITY : cls == FastComparator.LEXICAL.getClass() ? FastComparator.LEXICAL : cls == FastComparator.REHASH.getClass() ? FastComparator.REHASH : super.newInstance(cls, inputElement);
        }

        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
        }
    };
    static final XMLFormat<Index> INDEX_XML = new XMLFormat(Index.ZERO.getClass()) { // from class: javolution.xml.XMLBinding.21
        @Override // javolution.xml.XMLFormat
        public boolean isReferenceable() {
            return false;
        }

        @Override // javolution.xml.XMLFormat
        public Object newInstance(Class cls, XMLFormat.InputElement inputElement) throws XMLStreamException {
            return Index.valueOf(inputElement.getAttribute("value", 0));
        }

        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            outputElement.setAttribute("value", ((Index) obj).intValue());
        }
    };
    static final XMLFormat<PersistentContext> PERSISTENT_CONTEXT_XML = new XMLFormat(new PersistentContext().getClass()) { // from class: javolution.xml.XMLBinding.22
        @Override // javolution.xml.XMLFormat
        public void read(XMLFormat.InputElement inputElement, Object obj) throws XMLStreamException {
            ((PersistentContext) obj).getIdToValue().putAll((FastMap) inputElement.get("References"));
        }

        @Override // javolution.xml.XMLFormat
        public void write(Object obj, XMLFormat.OutputElement outputElement) throws XMLStreamException {
            outputElement.add(((PersistentContext) obj).getIdToValue(), "References");
        }
    };
    private String _classAttributeName = "class";
    private String _classAttributeURI = null;
    private FastMap _classToAlias = new FastMap();
    private FastMap _aliasToClass = new FastMap();

    private XMLFormat searchFormat(Class cls) {
        ClassInitializer.initialize(cls);
        int i = XMLFormat._ClassInstancesLength;
        XMLFormat xMLFormat = null;
        for (int i2 = 0; i2 < i; i2++) {
            XMLFormat xMLFormat2 = XMLFormat._ClassInstances[i2];
            if (xMLFormat2._class.isAssignableFrom(cls) && (xMLFormat == null || xMLFormat._class.isAssignableFrom(xMLFormat2._class))) {
                xMLFormat = xMLFormat2;
            }
        }
        if (xMLFormat != null) {
            STATIC_MAPPING.put(cls, xMLFormat);
            return xMLFormat;
        }
        throw new JavolutionError("Cannot find format for " + cls);
    }

    private static CharSequence toCsq(Object obj) {
        return Javolution.j2meToCharSeq(obj);
    }

    protected Class getClass(CharArray charArray) throws ClassNotFoundException {
        Class cls = (Class) this._aliasToClass.get(charArray);
        return cls != null ? cls : Reflection.getClass(charArray);
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public Class getClass(CharArray charArray, CharArray charArray2) throws ClassNotFoundException {
        return getClass(charArray);
    }

    public <T> XMLFormat<T> getFormat(Class<T> cls) {
        Object obj = STATIC_MAPPING.get(cls);
        return obj != null ? (XMLFormat) obj : searchFormat(cls);
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public String getLocalName(Class cls) {
        return getName(cls);
    }

    protected String getName(Class cls) {
        String str = (String) this._classToAlias.get(cls);
        return str != null ? str : cls.getName();
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public String getURI(Class cls) {
        return null;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final Class readClassAttribute(XMLStreamReaderImpl xMLStreamReaderImpl) throws XMLStreamException {
        String str = this._classAttributeName;
        if (str != null) {
            CharArray attributeValue = xMLStreamReaderImpl.getAttributeValue(this._classAttributeURI, str);
            if (attributeValue != null) {
                try {
                    return getClass(attributeValue);
                } catch (ClassNotFoundException e) {
                    throw new XMLStreamException(e);
                }
            }
            throw new XMLStreamException("Cannot retrieve class (class attribute not found)");
        }
        throw new XMLStreamException("Binding has no class attribute defined, cannot retrieve class");
    }

    @Override // javolution.lang.Reusable
    public void reset() {
        this._aliasToClass.reset();
        this._classToAlias.reset();
    }

    public void setAlias(Class cls, String str) {
        Class cls2 = (Class) this._aliasToClass.put(str, cls);
        if (cls2 != null) {
            this._classToAlias.put(cls2, null);
        }
        this._classToAlias.put(cls, str);
    }

    public void setClassAttribute(String str) {
        this._classAttributeName = str;
        this._classAttributeURI = null;
    }

    public void setClassAttribute(String str, String str2) {
        this._classAttributeName = str;
        this._classAttributeURI = str2;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void writeClassAttribute(XMLStreamWriterImpl xMLStreamWriterImpl, Class cls) throws XMLStreamException {
        if (this._classAttributeName != null) {
            String name = getName(cls);
            String str = this._classAttributeURI;
            if (str == null) {
                xMLStreamWriterImpl.writeAttribute(this._classAttributeName, name);
            } else {
                xMLStreamWriterImpl.writeAttribute(str, this._classAttributeName, name);
            }
        }
    }
}
